package com.ice.config;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * 邮件认证类
 *
 * @author icewinters
 */
public class EmailAuthenticator extends Authenticator {

    String userName = null;

    String password = null;

    public EmailAuthenticator() {
    }

    public EmailAuthenticator(String username, String password) {
        this.userName = username;
        this.password = password;
    }

    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(userName, password);
    }

}
